cargo.git
11 years agoauto merge of #72 : Arcterus/cargo/master, r=alexcrichton
bors [Fri, 27 Jun 2014 04:45:52 +0000 (04:45 +0000)]
auto merge of #72 : Arcterus/cargo/master, r=alexcrichton

Now Cargo should give a normal error message rather than a task failure when encountering an SSH URL as a dependency.

11 years agoError out on ssh dependencies (fixes #55)
Arcterus [Fri, 27 Jun 2014 03:51:25 +0000 (20:51 -0700)]
Error out on ssh dependencies (fixes #55)

11 years agoauto merge of #70 : alexcrichton/cargo/buildbot, r=wycats
bors [Fri, 27 Jun 2014 03:36:24 +0000 (03:36 +0000)]
auto merge of #70 : alexcrichton/cargo/buildbot, r=wycats

* The installation script was modified to recognize when its running on windows,
  as well as tweaking how it downloads and installs snapshots. The goal here was
  to make the script runnable on buildbot for mac/linux/windows with 32/64 bit
  options on mac/linux.

* The installation script now install rustc to `rustc/bin` in the local
  directory to have parallel builds on buildbot.

* The tests now store all their temporary state locally in the build directory
  to enable parallel builds on buildbot.

* A shell test is ignored which assumed the presence of a TTY output.

11 years agoPrepare for buildbot automation
Alex Crichton [Wed, 25 Jun 2014 23:31:57 +0000 (16:31 -0700)]
Prepare for buildbot automation

* The installation script was modified to recognize when its running on windows,
  as well as tweaking how it downloads and installs snapshots. The goal here was
  to make the script runnable on buildbot for mac/linux/windows with 32/64 bit
  options on mac/linux.

* The installation script now install rustc to `rustc/bin` in the local
  directory to have parallel builds on buildbot.

* The tests now store all their temporary state locally in the build directory
  to enable parallel builds on buildbot.

* A shell test is ignored which assumed the presence of a TTY output.

11 years agoFix temporary error message to be clearer
Yehuda Katz + Carl Lerche [Fri, 27 Jun 2014 00:10:00 +0000 (17:10 -0700)]
Fix temporary error message to be clearer

11 years ago100 chars
Yehuda Katz + Carl Lerche [Thu, 26 Jun 2014 23:51:37 +0000 (16:51 -0700)]
100 chars

11 years agoAdd cargo test
Tim Carey-Smith [Thu, 26 Jun 2014 22:14:31 +0000 (15:14 -0700)]
Add cargo test

11 years agoMerge pull request #64 from alexcrichton/no-recompile-nested-deps
Yehuda Katz [Wed, 25 Jun 2014 23:02:24 +0000 (16:02 -0700)]
Merge pull request #64 from alexcrichton/no-recompile-nested-deps

Don't recompile nested deps too frequently

11 years agoDon't recompile nested deps too frequently
Alex Crichton [Wed, 25 Jun 2014 18:53:19 +0000 (11:53 -0700)]
Don't recompile nested deps too frequently

When compiling a package with a nested dependency, any modification to the outer
package would trigger a recompilation of the inner package. This commit alters
the fingerprint() method to take a PackageId to query about the location of a
package and only lookup the files relevant to that package.

The dependency structure of a PathSource is now everything rooted at the
original Cargo.toml minus all subdirectories which contain a Cargo.toml

11 years agoMerge pull request #56 from alexcrichton/fix-windows-tests
Yehuda Katz [Wed, 25 Jun 2014 18:56:40 +0000 (11:56 -0700)]
Merge pull request #56 from alexcrichton/fix-windows-tests

Fix all tests on windows

11 years agoIgnore \r in output matching
Alex Crichton [Wed, 25 Jun 2014 05:09:23 +0000 (22:09 -0700)]
Ignore \r in output matching

Windows occasionally has \r\n while everywhere else has \n. Instead of worrying
about the difference, just replace all instances of \r with nothing and rely on
matching against \n.

11 years agoFix lots of windows tests
Alex Crichton [Wed, 25 Jun 2014 05:06:11 +0000 (22:06 -0700)]
Fix lots of windows tests

* Add a convenience method bin() for generating the name of a binary. On windows
  this remembers to append `.exe`.

* Stop executing relative paths to binaries and relying on PATH. This is
  suffering from rust-lang/rust#15149 and failing to spawn processes on windows.
  Additionally, this allows the tests to work with a pre-installed cargo becuase
  the freshly built executables are precisely specified.

* A new function, escape_path(), was added for tests. When generated source
  files with paths, this function needs to be called to properly escape the
  \-character that appears in windows path names. Without this function we would
  be generating invalid TOML and rust.

11 years agoSwitch the process builder to starting from ToCStr
Alex Crichton [Wed, 25 Jun 2014 05:05:33 +0000 (22:05 -0700)]
Switch the process builder to starting from ToCStr

This is the same as the libstd Command builder, and will soon be used in the
tests for spawning processes on windows.

11 years agoFix rm_rf on windows
Alex Crichton [Wed, 25 Jun 2014 05:04:57 +0000 (22:04 -0700)]
Fix rm_rf on windows

Apparently git checkouts have objects in the database with permissions 444 which
need to be changed to something with a write permission before removal.

11 years agoDisable terminal tests on windows
Alex Crichton [Wed, 25 Jun 2014 05:04:13 +0000 (22:04 -0700)]
Disable terminal tests on windows

The windows terminal does not use terminfo and is much different, so these tests
will fail on windows or actually write to the console.

11 years agoMove from all-URL to Path/URL enum
Alex Crichton [Wed, 25 Jun 2014 05:02:21 +0000 (22:02 -0700)]
Move from all-URL to Path/URL enum

On windows a path cannot be represented as a file:// URL because of the
backslashes and colons in the file name. This causes all of the tests which rely
on git to fail on windows. This commit changes the representation of the
location of a package to be an enum, Location, with two variants: Remote and
Local.

When parsing Cargo.toml, all locations which begin with the string "file:" have
that prefix stripped and are then interpreted as Local packages. Everything else
is parsed as a URL and used as a Remote package.

11 years agoFix the toml-rs build location
Alex Crichton [Wed, 25 Jun 2014 05:01:02 +0000 (22:01 -0700)]
Fix the toml-rs build location

11 years agoUse correct path separator on windows
Alex Crichton [Tue, 24 Jun 2014 13:54:37 +0000 (06:54 -0700)]
Use correct path separator on windows

11 years agoMerge pull request #63 from dtrebbien/patch-update-toml-rs
Alex Crichton [Wed, 25 Jun 2014 17:40:06 +0000 (13:40 -0400)]
Merge pull request #63 from dtrebbien/patch-update-toml-rs

Update libs/toml-rs

11 years agoUpdate libs/toml-rs
Daniel Trebbien [Wed, 25 Jun 2014 17:10:21 +0000 (13:10 -0400)]
Update libs/toml-rs

Include alexcrichton/toml-rs@66c8348

11 years agoMerge pull request #59 from mcpherrinm/nobloat
Alex Crichton [Wed, 25 Jun 2014 13:32:09 +0000 (09:32 -0400)]
Merge pull request #59 from mcpherrinm/nobloat

Delete tests binary, which doesn't belong

11 years agoMerge pull request #53 from huonw/version-error
Alex Crichton [Wed, 25 Jun 2014 13:16:43 +0000 (09:16 -0400)]
Merge pull request #53 from huonw/version-error

Handle misformatted versions with a nicer error message.

11 years agoHandle misformatted versions with a nicer error message.
Huon Wilson [Wed, 25 Jun 2014 01:48:38 +0000 (11:48 +1000)]
Handle misformatted versions with a nicer error message.

11 years agoRename make distclean -> clean-all
Carl Lerche [Tue, 24 Jun 2014 22:50:15 +0000 (15:50 -0700)]
Rename make distclean -> clean-all

11 years agoAdd support for branch/tag/rev options
Yehuda Katz [Tue, 24 Jun 2014 22:23:03 +0000 (15:23 -0700)]
Add support for branch/tag/rev options

11 years agoUpdate README.md
Yehuda Katz [Tue, 24 Jun 2014 20:37:28 +0000 (13:37 -0700)]
Update README.md

11 years agoMerge pull request #49 from o11c/install-paths
Yehuda Katz [Tue, 24 Jun 2014 20:34:40 +0000 (13:34 -0700)]
Merge pull request #49 from o11c/install-paths

Correct installation to follow standards

11 years agoMerge pull request #48 from gilles-leblanc/issue40
Yehuda Katz [Tue, 24 Jun 2014 20:29:56 +0000 (13:29 -0700)]
Merge pull request #48 from gilles-leblanc/issue40

Adds .vagrant files to .gitignore

11 years agoRemoves vagrant files from project
Gilles Leblanc [Tue, 24 Jun 2014 16:29:17 +0000 (12:29 -0400)]
Removes vagrant files from project

Fixes #40

11 years agoMerge pull request #50 from alexcrichton/license
Brian Anderson [Tue, 24 Jun 2014 19:50:19 +0000 (12:50 -0700)]
Merge pull request #50 from alexcrichton/license

Add the standard Rust Apache/MIT license

11 years agoAdd the standard Rust Apache/MIT license
Alex Crichton [Tue, 24 Jun 2014 15:10:31 +0000 (08:10 -0700)]
Add the standard Rust Apache/MIT license

This copies the same Apache and MIT license files from the rust-lang/rust
repository to the cargo repository. It notable retains the same copyright line
as the rust repository:

    Copyright (c) 2014 The Rust Project Developers

The COPYRIGHT file from the rust repository was not copied over as it looked
like it mainly contained information about third party dependencies, which cargo
does not have yet.

The wording at the end of the rust repository's README.md was also copied over
to cargo's README.md with tweaks to not mention COPYRIGHT and third-party BSD
licenses.

Closes #34

11 years agoCorrect installation to follow standards
Ben Longbons [Tue, 24 Jun 2014 18:10:27 +0000 (11:10 -0700)]
Correct installation to follow standards

11 years agoClarify `make install` exists as a target
Alex Crichton [Tue, 24 Jun 2014 13:44:47 +0000 (06:44 -0700)]
Clarify `make install` exists as a target

Closes #39

11 years agoUpdate README.md
Yehuda Katz [Tue, 24 Jun 2014 06:09:03 +0000 (23:09 -0700)]
Update README.md

11 years agoMerge pull request #31 from alexcrichton/hotfix-windows2
Yehuda Katz [Tue, 24 Jun 2014 05:49:11 +0000 (22:49 -0700)]
Merge pull request #31 from alexcrichton/hotfix-windows2

Work around \-characters on Windows for now

11 years agoWork around \-characters on Windows for now
Alex Crichton [Tue, 24 Jun 2014 05:21:19 +0000 (22:21 -0700)]
Work around \-characters on Windows for now

11 years agoRename cargo-compile to cargo-build
Yehuda Katz [Tue, 24 Jun 2014 02:09:12 +0000 (19:09 -0700)]
Rename cargo-compile to cargo-build

11 years agoOnly force update git if -u is passed
Yehuda Katz [Tue, 24 Jun 2014 01:54:13 +0000 (18:54 -0700)]
Only force update git if -u is passed

This will become moot once we have a lockfile, because we'll be able to
check whether the last rev we used is still available and skip fetching.

11 years agoAllow absent git version
Yehuda Katz [Tue, 24 Jun 2014 00:38:43 +0000 (17:38 -0700)]
Allow absent git version

11 years agoGitSource delegates to PathSource for path ops
Carl Lerche [Tue, 24 Jun 2014 00:03:13 +0000 (17:03 -0700)]
GitSource delegates to PathSource for path ops

11 years agoFix the README
Yehuda Katz [Tue, 24 Jun 2014 00:02:22 +0000 (17:02 -0700)]
Fix the README

11 years agoSupport [package] or [project]
Yehuda Katz [Mon, 23 Jun 2014 23:57:27 +0000 (16:57 -0700)]
Support [package] or [project]

The plan is to free up [project] for simpler config plus output flags
like -O that don't make sense in packages.

11 years agoMerge pull request #29 from cmr/make-install
Yehuda Katz [Mon, 23 Jun 2014 23:34:44 +0000 (16:34 -0700)]
Merge pull request #29 from cmr/make-install

Makefile: support install, makes packaging easier

11 years agoSpecify the SourceId that the path source represents
Carl Lerche [Mon, 23 Jun 2014 23:16:22 +0000 (16:16 -0700)]
Specify the SourceId that the path source represents

11 years agoMakefile: support install, makes packaging easier
Corey Richardson [Mon, 23 Jun 2014 22:33:14 +0000 (15:33 -0700)]
Makefile: support install, makes packaging easier

11 years agoMerge pull request #28 from alexcrichton/new-toml
Yehuda Katz [Mon, 23 Jun 2014 21:13:59 +0000 (14:13 -0700)]
Merge pull request #28 from alexcrichton/new-toml

Move from rust-toml to toml-rs

11 years agoMove from rust-toml to toml-rs
Alex Crichton [Mon, 23 Jun 2014 15:39:50 +0000 (08:39 -0700)]
Move from rust-toml to toml-rs

This commit should greatly improve all error messages related to decoding
Cargo.toml.

11 years agoFix long lines
Alex Crichton [Mon, 23 Jun 2014 17:30:25 +0000 (10:30 -0700)]
Fix long lines

11 years agoFix a red test
Alex Crichton [Mon, 23 Jun 2014 16:44:00 +0000 (09:44 -0700)]
Fix a red test

11 years agoSimplify flags
Yehuda Katz [Sun, 22 Jun 2014 06:51:55 +0000 (23:51 -0700)]
Simplify flags

11 years agoImprove error messages
Yehuda Katz [Sun, 22 Jun 2014 06:16:12 +0000 (23:16 -0700)]
Improve error messages

11 years agoMore shell refactoring
Yehuda Katz [Sun, 22 Jun 2014 06:02:38 +0000 (23:02 -0700)]
More shell refactoring

11 years agoThread the shell through more of the system
Yehuda Katz [Sun, 22 Jun 2014 05:22:56 +0000 (22:22 -0700)]
Thread the shell through more of the system

11 years agoTerminal colors
Yehuda Katz [Sun, 22 Jun 2014 01:53:07 +0000 (18:53 -0700)]
Terminal colors

11 years agoAdds initial usage support
Yehuda Katz [Sat, 21 Jun 2014 23:15:31 +0000 (16:15 -0700)]
Adds initial usage support

11 years agoImprove error messages
Yehuda Katz [Sat, 21 Jun 2014 06:26:19 +0000 (23:26 -0700)]
Improve error messages

11 years agoMake try! an extended version of std::try!
Yehuda Katz [Sat, 21 Jun 2014 02:18:06 +0000 (19:18 -0700)]
Make try! an extended version of std::try!

The only caveat to this is that you cannot use try! inside of a function
that return a Result to another function that expects a totally generic
error.

The primary case of this is Encodable/Decodable, which call into
user-specified methods, expecting an `E` back. In these (extremely
unusual) cases, you can use raw_try!.

Of note:

* Once Error lands in core (optimistic much?), Encodable/Decodable can
  be changed to expect an E: Error + FromError<E>.
* This works fine with concrete error types, since FromError maps things
  like IoError to IoError. The only reason it doesn't work with totally
  generic E is that we can't implement FromError<Box<Error>> for
  impl Error and FromError<E> for E.

11 years agoHandle some errors better
Tim Carey-Smith + Tom Dale [Sat, 21 Jun 2014 00:51:35 +0000 (17:51 -0700)]
Handle some errors better

Also, use cargo_try in more places

11 years agoMerge pull request #25 from alexcrichton/fingerprints
Yehuda Katz [Fri, 20 Jun 2014 05:13:29 +0000 (22:13 -0700)]
Merge pull request #25 from alexcrichton/fingerprints

Don't rebuild dependencies if they haven't changed

11 years agoDon't rebuild dependencies if they haven't changed
Alex Crichton [Fri, 20 Jun 2014 01:53:18 +0000 (18:53 -0700)]
Don't rebuild dependencies if they haven't changed

This commit adds support for recognizing "fingerprints" of upstream
dependencies. When a dependency's fingerprint change, it must be rebuilt.
Currently the fingerprint unconditionally includes the version of the compiler
you're using as well as a specialized version depending on the type of source
you're compiling from:

  - git sources return their fingerprint as the current SHA. This will
    disregard any local changes.
  - path sources return their fingerprint as the maximum mtime of any file found
    at the location. This is a little too coarse and may rebuild packages too
    often (due to sub-packages), but this should get the job done for now.

When executing `cargo compile`, dependencies are not rebuilt if their
fingerprint remained constant.

11 years agoMerge pull request #23 from alexcrichton/crate-types
Yehuda Katz [Fri, 20 Jun 2014 02:49:56 +0000 (19:49 -0700)]
Merge pull request #23 from alexcrichton/crate-types

Invoke rustc only once for multiple crate types

11 years agoInvoke rustc only once for multiple crate types
Alex Crichton [Thu, 19 Jun 2014 22:21:00 +0000 (15:21 -0700)]
Invoke rustc only once for multiple crate types

11 years agoMerge pull request #24 from alexcrichton/style
Yehuda Katz [Fri, 20 Jun 2014 01:58:52 +0000 (18:58 -0700)]
Merge pull request #24 from alexcrichton/style

Update to rust style guidelines

11 years agoUpdate to rust style guidelines
Alex Crichton [Thu, 19 Jun 2014 23:45:19 +0000 (16:45 -0700)]
Update to rust style guidelines

* 80 char line limit highly recommended
* /// and //! for doc comments

11 years agoGet travis working on OSX
Alex Crichton [Thu, 19 Jun 2014 22:27:12 +0000 (15:27 -0700)]
Get travis working on OSX

11 years agoAdd --verbose cause chain support
Yehuda Katz [Thu, 19 Jun 2014 21:13:39 +0000 (14:13 -0700)]
Add --verbose cause chain support

11 years agoMerge pull request #18 from erickt/master
Alex Crichton [Thu, 19 Jun 2014 19:00:37 +0000 (12:00 -0700)]
Merge pull request #18 from erickt/master

Fix a typo in the README

11 years agoMerge pull request #22 from alexcrichton/make
Yehuda Katz [Thu, 19 Jun 2014 18:53:49 +0000 (11:53 -0700)]
Merge pull request #22 from alexcrichton/make

Allow executing an arbitrary command before building

11 years agoUpdate hammer.rs
Alex Crichton [Thu, 19 Jun 2014 18:40:16 +0000 (11:40 -0700)]
Update hammer.rs

11 years agoAdd a .travis.yml
Alex Crichton [Wed, 18 Jun 2014 20:36:49 +0000 (13:36 -0700)]
Add a .travis.yml

11 years agoRun tests in parallel
Alex Crichton [Wed, 18 Jun 2014 20:18:36 +0000 (13:18 -0700)]
Run tests in parallel

Give each test is own root inside of the shared root to ensure that the tests
are still isolated from one another.

11 years agoMake CARGO_BIN_PATH optional for tests
Alex Crichton [Wed, 18 Jun 2014 20:14:56 +0000 (13:14 -0700)]
Make CARGO_BIN_PATH optional for tests

This allows easier use of running tests by hand.

11 years agoAllow custom precompile commands
Alex Crichton [Wed, 18 Jun 2014 20:09:19 +0000 (13:09 -0700)]
Allow custom precompile commands

This commit enables support for custom precompilation commands to be triggered
before a package builds via rustc. The current interface is to have
`build = "foo"` in the `[project]` section of Cargo.toml and cargo will just
execute the exact command given.

11 years agoProvide more context on process errors
Alex Crichton [Wed, 18 Jun 2014 19:01:54 +0000 (12:01 -0700)]
Provide more context on process errors

When printing an error for a failed process execution, the stdout/stderr are
included for inspection.

11 years agoOptimized mark_human for ConcreteCargoError
Yehuda Katz [Thu, 19 Jun 2014 18:52:49 +0000 (11:52 -0700)]
Optimized mark_human for ConcreteCargoError

11 years agoAdd CargoError::with_cause
Yehuda Katz [Thu, 19 Jun 2014 18:49:50 +0000 (11:49 -0700)]
Add CargoError::with_cause

This allows concrete implementations with a `cause` field to have a
better implementation than converting the entire original error into a
concrete representation.

11 years agoAdd mark_human
Yehuda Katz [Thu, 19 Jun 2014 18:02:24 +0000 (11:02 -0700)]
Add mark_human

11 years agoRename to
Yehuda Katz [Thu, 19 Jun 2014 17:43:46 +0000 (10:43 -0700)]
Rename  to

11 years agoRequire human-tagging errors
Yehuda Katz [Thu, 19 Jun 2014 17:12:51 +0000 (10:12 -0700)]
Require human-tagging errors

11 years agoAdd FromError
Yehuda Katz [Thu, 19 Jun 2014 16:33:09 +0000 (09:33 -0700)]
Add FromError

11 years agoAdd cargo_try!
Yehuda Katz [Thu, 19 Jun 2014 15:13:58 +0000 (08:13 -0700)]
Add cargo_try!

11 years agoSquelch warnings and minor cleanup
Yehuda Katz [Thu, 19 Jun 2014 08:21:24 +0000 (01:21 -0700)]
Squelch warnings and minor cleanup

11 years agoInitial pass at boxed errors
Yehuda Katz [Thu, 19 Jun 2014 07:55:17 +0000 (00:55 -0700)]
Initial pass at boxed errors

The next step is to clean up the error handling in general so that
failure cases produce good errors.

11 years agoPathSource - load packages in update fn
Carl Lerche [Wed, 18 Jun 2014 21:42:07 +0000 (14:42 -0700)]
PathSource - load packages in update fn

11 years agoSource::update takes mutable self
Carl Lerche [Wed, 18 Jun 2014 19:33:22 +0000 (12:33 -0700)]
Source::update takes mutable self

11 years agoSupport nested paths in git and path sources
Yehuda Katz + Carl Lerche [Wed, 18 Jun 2014 00:40:22 +0000 (17:40 -0700)]
Support nested paths in git and path sources

11 years agoPaths nested in paths
Yehuda Katz + Carl Lerche [Wed, 18 Jun 2014 00:05:29 +0000 (17:05 -0700)]
Paths nested in paths

11 years agoImprovements to transitive dependency infra
Yehuda Katz + Carl Lerche [Tue, 17 Jun 2014 22:36:50 +0000 (15:36 -0700)]
Improvements to transitive dependency infra

Initial work to enable cross-source transitive dependencies.

11 years agoWIP3
Yehuda Katz + Carl Lerche [Tue, 17 Jun 2014 01:16:34 +0000 (18:16 -0700)]
WIP3

11 years agoMake `cargo foo` work
Yehuda Katz + Carl Lerche [Mon, 16 Jun 2014 21:51:19 +0000 (14:51 -0700)]
Make `cargo foo` work

11 years agoTrack Rust master
Carl Lerche [Mon, 16 Jun 2014 19:57:34 +0000 (12:57 -0700)]
Track Rust master

11 years agoFix a typo in the README
Erick Tryzelaar [Sat, 14 Jun 2014 05:14:55 +0000 (22:14 -0700)]
Fix a typo in the README

11 years agoBetter file names
Carl Lerche + Yehuda Katz [Fri, 13 Jun 2014 22:06:15 +0000 (15:06 -0700)]
Better file names

11 years agoFix tests
Carl Lerche + Yehuda Katz [Fri, 13 Jun 2014 21:19:06 +0000 (14:19 -0700)]
Fix tests

11 years agoAllow multiple and non-default crate_types
Carl Lerche + Yehuda Katz [Fri, 13 Jun 2014 00:49:10 +0000 (17:49 -0700)]
Allow multiple and non-default crate_types

Note that at present there is no good error handling for fat-fingering
the crate type. This is a TODO.

11 years agoSmoke test for git support
Carl Lerche + Yehuda Katz [Thu, 12 Jun 2014 22:51:16 +0000 (15:51 -0700)]
Smoke test for git support

11 years agoUpdate to master and fix warnings
Yehuda Katz + Carl Lerche [Thu, 12 Jun 2014 20:45:10 +0000 (13:45 -0700)]
Update to master and fix warnings

11 years agoGlue together git in manifest with Source
Yehuda Katz + Carl Lerche [Thu, 12 Jun 2014 00:38:50 +0000 (17:38 -0700)]
Glue together git in manifest with Source

11 years agoSources are now an array
Yehuda Katz + Carl Lerche [Wed, 11 Jun 2014 22:59:18 +0000 (15:59 -0700)]
Sources are now an array

11 years agoAdd namespace to PackageId
Yehuda Katz + Carl Lerche [Wed, 11 Jun 2014 21:50:54 +0000 (14:50 -0700)]
Add namespace to PackageId